Optimal. Leaf size=63 \[ -\frac{i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac{i a^3}{4 d (a-i a \tan (c+d x))}+\frac{a^2 x}{4} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0607932, antiderivative size = 63, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {3487, 44, 206} \[ -\frac{i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac{i a^3}{4 d (a-i a \tan (c+d x))}+\frac{a^2 x}{4} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3487
Rule 44
Rule 206
Rubi steps
\begin{align*} \int \cos ^4(c+d x) (a+i a \tan (c+d x))^2 \, dx &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \frac{1}{(a-x)^3 (a+x)} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{\left (i a^5\right ) \operatorname{Subst}\left (\int \left (\frac{1}{2 a (a-x)^3}+\frac{1}{4 a^2 (a-x)^2}+\frac{1}{4 a^2 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac{i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac{i a^3}{4 d (a-i a \tan (c+d x))}-\frac{\left (i a^3\right ) \operatorname{Subst}\left (\int \frac{1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{4 d}\\ &=\frac{a^2 x}{4}-\frac{i a^4}{4 d (a-i a \tan (c+d x))^2}-\frac{i a^3}{4 d (a-i a \tan (c+d x))}\\ \end{align*}
Mathematica [A] time = 0.440161, size = 86, normalized size = 1.37 \[ \frac{a^2 ((1-4 i d x) \sin (2 (c+d x))+(4 d x-i) \cos (2 (c+d x))-4 i) (\cos (2 (c+2 d x))+i \sin (2 (c+2 d x)))}{16 d (\cos (d x)+i \sin (d x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.055, size = 100, normalized size = 1.6 \begin{align*}{\frac{1}{d} \left ( -{a}^{2} \left ( -{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{3}\sin \left ( dx+c \right ) }{4}}+{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{8}}+{\frac{dx}{8}}+{\frac{c}{8}} \right ) -{\frac{i}{2}}{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{4}+{a}^{2} \left ({\frac{\sin \left ( dx+c \right ) }{4} \left ( \left ( \cos \left ( dx+c \right ) \right ) ^{3}+{\frac{3\,\cos \left ( dx+c \right ) }{2}} \right ) }+{\frac{3\,dx}{8}}+{\frac{3\,c}{8}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.64277, size = 90, normalized size = 1.43 \begin{align*} \frac{{\left (d x + c\right )} a^{2} + \frac{a^{2} \tan \left (d x + c\right )^{3} + 3 \, a^{2} \tan \left (d x + c\right ) - 2 i \, a^{2}}{\tan \left (d x + c\right )^{4} + 2 \, \tan \left (d x + c\right )^{2} + 1}}{4 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.14616, size = 105, normalized size = 1.67 \begin{align*} \frac{4 \, a^{2} d x - i \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} - 4 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )}}{16 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.449745, size = 88, normalized size = 1.4 \begin{align*} \frac{a^{2} x}{4} + \begin{cases} \frac{- 4 i a^{2} d e^{4 i c} e^{4 i d x} - 16 i a^{2} d e^{2 i c} e^{2 i d x}}{64 d^{2}} & \text{for}\: 64 d^{2} \neq 0 \\x \left (\frac{a^{2} e^{4 i c}}{4} + \frac{a^{2} e^{2 i c}}{2}\right ) & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.19227, size = 347, normalized size = 5.51 \begin{align*} \frac{8 \, a^{2} d x e^{\left (4 i \, d x + 2 i \, c\right )} + 16 \, a^{2} d x e^{\left (2 i \, d x\right )} + 8 \, a^{2} d x e^{\left (-2 i \, c\right )} - i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 2 i \, a^{2} e^{\left (2 i \, d x\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - i \, a^{2} e^{\left (-2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) + 2 i \, a^{2} e^{\left (2 i \, d x\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) + i \, a^{2} e^{\left (-2 i \, c\right )} \log \left (e^{\left (2 i \, d x\right )} + e^{\left (-2 i \, c\right )}\right ) - 2 i \, a^{2} e^{\left (8 i \, d x + 6 i \, c\right )} - 12 i \, a^{2} e^{\left (6 i \, d x + 4 i \, c\right )} - 18 i \, a^{2} e^{\left (4 i \, d x + 2 i \, c\right )} - 8 i \, a^{2} e^{\left (2 i \, d x\right )}}{32 \,{\left (d e^{\left (4 i \, d x + 2 i \, c\right )} + 2 \, d e^{\left (2 i \, d x\right )} + d e^{\left (-2 i \, c\right )}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]